import request from "@/utils/request";

//查询船舶列表接口(复核列表用) 要cbzt ==1  正常的船
export function getAllShipListPaging(data, pageNumber, pageSize){
  return request({
    url: '/yxdd/ship/query/page?page='+ pageNumber+ '&size='+ pageSize,
    data: data,
    method:'post',
  })
}

//注销该船舶
//?cbid='+ data.cbid+ '&zxyy='+ data.zxyy
export function logoutShip(data){
  return request(
    {
      url:'/yxdd/ship/logout',
      data: data,
      method:'post',
    }
  )
}


/*
* code:200
data:Array(1)
0: "http://1.13.171.55:9990/fileclient1/11111111111111_9f1a9f6a-27ae-48f2-9c21-2d53c7daae18.png"
length: 1
message: "OK"
success: true
*
* **/

//根据图片文件id 返回url fileIds 逗号分割
// let r = await getUrlByFileId('3283913364571648,3283911329302016')
export function getUrlByFileId(fileIds){
  return request({
    url: '/yxdd/file/fileIdGetUrl/'+ fileIds,
    data: {},
    method:'post',
  })
}

// /ship/review 复核对话框的  复核按钮用 data 为船舶的信息记录
export function submitCheckInfoToAudit(data){
  return request(
    {
      url: '/yxdd/ship/review',
      data: data,
      method:'post',
    }
  )
}

//ship/review/list 审核列表接口 // {cmch}
// 无分页
export function getAuditList(data){
  return request(
    {
      url: '/yxdd/ship/review/list',
      data: data,
      method:'post',
    }
  )
}

//ship/review/list 审核列表接口 //
/**
 *  params ={
 *    data:{ cmcm, ...},
 *    pageNumber: 1,
 *    pageSize: 10,
 *  }
 * */
// 分页
export function getAuditListPage(params){
  let {data, page, size} = params;
  return request(
    {
      url:'/yxdd/ship/review/page?page='+ page + '&size='+ size,
      data:data,
      method:'post'
    }
  )
}

//查询原复核数据 //可传入cbid
export function getOldShipInfoBeforeCheck(data){
  return request(
    {
      url: '/yxdd/ship/query/one',
      data: data,
      method:'post',
    }
  )
}

//ship/review/check  审核保存按钮接口,
/**
 * {
	"cbfhId": 0,
	"shyy": "",
	"shzt": 0  // 船舶复核状态2通过 3驳回
}
 * */
//批准审核
export function agreeAudit(data){
  return request(
    {
      url: '/yxdd/ship/review/check',
      data: data,
      method:'post',
    }
  )
}

//获取工班人员列表 by gbId
//2023-5-9 zrc 取cyList
export function getGbryListByGbid(gbId){
  return request(
    {
      url: `/yxdd/gbsz/get/${gbId}`,
      method:'post'
    }
  )
}







